#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	int i = 0;
	char c = 0;
	while (scanf("%c", &c) != EOF)
	{
		if (97 <= c && c <= 122)
			c -= 32;
		else if ('A' <= c && c <= 'Z')
			c += 32;
		printf("%c", c);
	}
	return 0;
}